package com.example.demo.huawei;

import java.util.Scanner;
public class OD62_2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String[] split = line.split("\\s");
        // k只可能  1 -1  2（平行）0 （垂直） 3 初始值
        StringBuilder sb = new StringBuilder();
        int lastK = 3;
        for (int i = 0; i < split.length - 3; i += 2) {
            int x2 = Integer.parseInt(split[i + 2]);
            int y2 = Integer.parseInt(split[i + 3]);
            int x1 = Integer.parseInt(split[i]);
            int y1 = Integer.parseInt(split[i + 1]);
            int k;
            if (x2 == x1) {
                k = 2;
            } else if (y2 == y1) {
                k = 0;
            } else {
                k = (y2 - y1) / (x2 - x1);
            }
            if (k != lastK) {
                lastK = k;
                sb.append(x1).append(" ").append(y1).append(" ");
            }
        }
        sb.append(split[split.length - 2]).append(" ").append(split[split.length - 1]);
        System.out.println(sb);
    }
}
